package com.gite.nouette.admin.implementation.view.command;

import com.gite.nouette.admin.contract.controller.command.ICCommandCreateModule;
import com.gite.nouette.admin.contract.view.command.IVCommandCreateModule;
import com.gite.nouette.admin.implementation.view.util.ViewUtil;
import com.smartgwt.client.widgets.Button;
import com.smartgwt.client.widgets.events.ClickHandler;

public class VCommandCreateModuleImpl extends Button implements
		IVCommandCreateModule {
	private ICCommandCreateModule controller = null;

	public VCommandCreateModuleImpl() {
		addClickHandler(createClickHandler());
	}

	@Override
	public ICCommandCreateModule getC() {
		return this.controller;
	}

	@Override
	public void setC(ICCommandCreateModule controller) {
		this.controller = controller;
	}

	@Override
	public String getName() {
		return ViewUtil.getName(this);
	}

	@Override
	public void setName(String name) {
		ViewUtil.setName(name, this);
	}

	@Override
	public boolean isActive() {
		return ViewUtil.isActive(this);
	}

	@Override
	public void active() {
		ViewUtil.active(this);
	}

	@Override
	public void desactive() {
		ViewUtil.desactive(this);
	}

	protected ClickHandler createClickHandler() {
		return ViewUtil.createClickHandler(this);
	}
}
